package com.black.cat.seed.entity;


import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import javax.validation.constraints.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 权限表
 *
 * @author blackcat
 * @since 2020-07-21
 */
@Data
@TableName("sec_permission")
@ApiModel(description = "权限表")
public class Permission implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @NotNull()
    @Null()
    private Long id;

    @ApiModelProperty(value = "权限名")
    @NotBlank
    private String name;

    @ApiModelProperty(value = "类型为页面时，代表前端路由地址，类型为按钮时，代表后端接口地址")
    private String url;

    @ApiModelProperty(value = "权限类型，页面-1，按钮-2")
    @NotNull
    private Integer type;

    @ApiModelProperty(value = "权限表达式")
    private String permission;

    @ApiModelProperty(value = "后端接口访问方式")
    private String method;

    @ApiModelProperty(value = "排序")
    @NotNull
    private Integer sort;

    @ApiModelProperty(value = "父级id")
    @NotNull
    private Long parentId;

}
